package com.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 王鑫
 * @create 2020 -11 -23 16:46
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@ApiModel("收藏电桩对象")
@TableName(value = "collect")
public class Collect implements Serializable {
    @ApiModelProperty(value = "主键")
    @TableId(value = "collect_id", type = IdType.ID_WORKER_STR)
    private String collectId;

    @ApiModelProperty(value = "用户对象")
    @TableField(exist = false)
    private User user;

    @ApiModelProperty(value = "充电桩对象")
    @TableField(exist = false)
    private Pile pile;

    @ApiModelProperty(value = "用户id")
    @TableField("user_id")
    private String userId;

    @ApiModelProperty(value = "充电桩id")
    @TableField("pile_id")
    private String pileId;


    @ApiModelProperty(value = "软删除状态（0：正常、1：已取消收藏）")
    @TableField("collect_state")
    @TableLogic
    private Integer collectState;

    @ApiModelProperty(value = "版本号，用于乐观锁")
    @TableField("collect_version")
    @Version
    private Integer collectVersion;

    @ApiModelProperty(value = "收藏时间")
    @TableField(value = "collect_create_time", fill = FieldFill.INSERT)
    private Date collectCreateTime;

    @ApiModelProperty(value = "修改收藏时间")
    @TableField(value = "collect_modify_time", fill = FieldFill.INSERT_UPDATE)
    private Date collectModifyTime;
}
